//截取查询字符串
function getUrlParamValue(name: string) {
    if (name == null || name === 'undefined') {
        return null;
    }
    const globalLocation = window.location;
    let searchIndex = globalLocation.href.indexOf('?');
    let searchStr = decodeURI(globalLocation.href.substring(searchIndex));
    let infoIndex = searchStr.indexOf(name + '=');
    if (infoIndex === -1) {
        return null;
    }
    let searchInfo = searchStr.substring(infoIndex + name.length + 1);
    let tagIndex = searchInfo.indexOf('&');
    if (tagIndex !== -1) {
        searchInfo = searchInfo.substring(0, tagIndex);
    }
    return searchInfo;
}
export default getUrlParamValue;